<?php
/**
 * @var string $namespace
 * @var string $version
 * @var string $prefix
 * @var string $middleware
 */
$api = app(Dingo\Api\Routing\Router::class);

$api->version($version, function (Dingo\Api\Routing\Router $api) use ($namespace, $prefix, $middleware) {
    $api->group(['namespace' => $namespace, 'prefix' => $prefix, 'middleware' => $middleware], function ($api) {
        /**
         * 获取表单
         */
        $api->get('/{id}', 'FormController@getForm');
        
        
        /**
         * 获取自定义显示列
         */
        $api->get('/{formId}/view', 'FormCustomViewController@getUserCustomView');
        
        /**
         * 修改自定义显示列
         */
        $api->put('/{formId}/view', 'FormCustomViewController@updateUserCustomView');
        /**
         * 修改自定义显示列宽度
         */
        $api->put('/view/{id}/resize', 'FormCustomViewController@resizeCustomView');
        
        /**
         * 获取自定义筛选
         */
        $api->get('/{formId}/filter', 'FormFilterGroupController@getUserFilterGroup');
        
        /**
         * 创建自定义筛选
         */
        $api->post('/{formId}/filter', 'FormFilterGroupController@createUserFilterGroup');
        /**
         * 删除自定义筛选
         */
        $api->delete('/filter/{id}', 'FormFilterGroupController@deleteUserFilterGroup');
        
        /**
         * 更新自定义筛选
         */
        $api->put('/filter/{id}', 'FormFilterGroupController@updateUserFilterGroup');
    });
});
